<{include file="common/header"}>
<script src="__JS__/pintuer.js"></script>
</head>
<body>
<div class="bg"></div>
<div class="container">
    <div class="line bouncein">
        <div class="xs6 xm4 xs3-move xm4-move">
            <div style="height:150px;"></div>
            <div class="media media-y margin-big-bottom">           
            </div>         
            <form action="<{:url('login/loginIn')}>" method="post">
                <input type="hidden" name="__token__" value="<{:token()}>" />
            <div class="panel loginbox">
                <div class="text-center margin-big padding-big-top"><h1>后台管理中心</h1></div>
                <div class="panel-body" style="padding:30px; padding-bottom:10px; padding-top:10px;">
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="text" class="input input-big login_count" name="uname" placeholder="登录账号" data-validate="required:请填写账号" />
                            <span class="icon icon-user margin-small"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="password" class="input input-big" name="upwd" placeholder="登录密码" data-validate="required:请填写密码" />
                            <span class="icon icon-key margin-small"></span>
                        </div>
                    </div>
                    <div class="form-group code_count " style="display: none">
                        <div class="field">
                            <input type="text" class="input input-big code" name="code" placeholder="填写右侧的验证码" />
                            <img src="<{:captcha_src()}>" alt="captcha"  width="100" height="32" class="passcode" style="height:43px;cursor:pointer;" onclick="this.src=this.src+'?'">
                                                   
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="checkbox" name="free" id="">三十天免登录
                            <!--<a href="<{:url('loginFile')}>" style="float: right">修改密码</a>-->
                        </div>
                    </div>
                </div>
                <div style="padding:30px;"><input type="submit" class="button button-block bg-main text-big input-big btn" value="登录"></div>
            </div>
            </form>          
        </div>
    </div>
</div>
</body>
</html>
<script>
    //账号错误三次时出现验证码
    $('.login_count').focus();
    $('.login_count').blur(function () {
       var uname=$(this).val();
       $.ajax({
           type:'post',
           data:{uname:uname},
           url:"<{:url('ajaxUnameCount')}>",
           dataType:'json',
           success:function (data){
                console.log(data);
               if(data['status']){
                   $('.btn').prop('disabled',true);
                   $('.code_count').show();
               }else{
                   $('.btn').prop('disabled',false);
                   $('.code_count').hide();
               }
           }
       })

    })

    //验证码错误时登录按钮禁用
$('.code').blur(function () {
   var code=$(this).val();
   $.ajax({
       type:'post',
       data:{code:code},
       url:"<{:url('login/ajaxCode')}>",
       dataType:'json',
       success:function (data){
            console.log(data);
            if(data['status']){
                $('.btn').prop('disabled',false);
            }else{
                $('.btn').prop('disabled',true);
            }
       }
   })




})




</script>